-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pose,object constraints #63
Support pose,object constraints #63
Conversation
fa6da45
to
31f9e46
Compare
have a review @sdfgeoff 🎉 there are three commits, so I just make a brief explanation:
as you can see, there is one minor problem I still not solved, |
@@ -141,15 +142,16 @@ class AnimationPlayer(NodeTemplate): | |||
def __init__(self, name, parent): | |||
super().__init__(name, "AnimationPlayer", parent) | |||
# use parent node as the animation root node | |||
self['root_node'] = NodePath(self.get_path(), self.parent.get_path()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious as to why parent and self.parent are different. From what I can see of NodeTemplate, they should be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it should be the same. While I develop on this PR, I removed it first and then add it back, so caused some inconsistence, I will fix it
need_bake = action_type == 'transform' and (has_obj_cst or has_pose_cst) | ||
|
||
def action_baker(action_to_bake): | ||
"""baker for transform action, note it is a closure""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite a closure. Sure, it's using the environment from the parent function but it isn't ever used outside it's parent function. If you were (for whatever reason) returning the action_baker
function from the end of export_animation_data
, then it would be a closure.
I would classify this just as a "nested function"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, I just want to keep a note that this function use variable outside
To support both you could run a check against bpy.app.version |
After I check the source code of |
do_visual_keying=True, | ||
) | ||
|
||
bpy.context.scene.objects.active = active_obj_backup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably not be only for blender 2.79!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, it should be place outside, I am so careless..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after think about a bit, I moved the active_obj_backup into the if block instead of move this line outside
Looking pretty good now. I think you can squash (after fixing the indentation of restoring the active object). |
edc7b85
to
f3df39d
Compare
I prefer to keep it as two commits (because they are separate two). then if something wrong happen, it is easy to drop one |
Yup, makes sense. |
…ction Support pose,object constraints
intent to solve #62 #38
it already worked on simple test case, though still several limitations